import type * as T from './type'
import http from '@/utils/http'
import type { LabelValueState } from '@/types/global'
const BASE_URL = '/system/recharge'
/** @desc 查询列表 */
export function listPage(query: T.RechargeQuery) {
  return http.get<PageRes<T.RechargePageQuery[]>>(`${BASE_URL}/page`, query)
}

export function lists() {
  return http.get<T.RechargeDto[]>(`${BASE_URL}/list`)
}

export function rechargeSelect() {
  return http.get<LabelValueState[]>(`${BASE_URL}/getSelectList`)
}

/** @desc 查询详情 */
export function getRecharge(id: string) {
  return http.get<T.RechargeDto>(`${BASE_URL}/getData/${id}`)
}


/** @desc 新增 */
export function addObject(data: any) {
  return http.post(`${BASE_URL}/create`, data)
}


/** @desc 修改状态 */
export function updateStatus(data: any) {
  return http.post(`${BASE_URL}/updateStatus`, data)
}


/** @desc 修改 */
export function updateObject(data: any) {
  return http.post(`${BASE_URL}/modify`, data)
}

/** @desc 删除 */
export function deleteObject(ids: string | Array<string>) {
  return http.del(`${BASE_URL}/delete/${ids}`)
}


/** @desc 刷新緩存 */
export function refreshCache() {
  return http.get(`${BASE_URL}/refreshCache`)
}
